$.get("/QueryAllcon")
    .done(list=>{
        list.forEach(function (contract) {
            var pot=$("<option/>");
            pot.val(contract.contractStartId);
            pot.text(contract.startName);
            pot.appendTo("#queryForm [name=contractStartId]");
        })
    })

$.get("/QueryAlltype")
    .done(list=>{
        list.forEach(function (contracttype) {
            var pot=$("<option/>");
            pot.val(contracttype.contractTypeId);
            pot.text(contracttype.typeName);
            pot.appendTo("#queryForm [name=contractTypeId]");
        })
    })
// -----------------------------------------以下是条件查询---------------------------------------------------
function chaxun() {
    var formParams=$("#queryForm").serialize();
    var obj=Qs.parse(formParams);
    $("#ContTb").bootstrapTable("refresh",{query:obj});

}

// -------------------------------------------查看详情--------------------------------------------------------------------------
function chakan() {
    var arr= $("#ContTb").bootstrapTable("getSelections");
    console.log(arr);
    if(arr.length==0) {
        swal({
            type: "warning",
            title: "友情提示！",
            text: "请至少选择一项待查看！",
            confirmButtonText: "ok"
        });
        return;
    }
    $("#See [name=contractName]").html(arr[0].contractName);
    $("#See [name=contractTypeId]").html(arr[0].contracttype.typeName);
    $("#See [name=contractStatus]").html(arr[0].contractstart.startName);
    $("#See [name=contractMoney]").html(arr[0].contractMoney);
    $("#See [name=partA]").html(arr[0].partA);
    $("#See [name=partB]").html(arr[0].partB);
    $("#See [name=partACode]").html(arr[0].partACode);
    $("#See [name=partBCode]").html(arr[0].partBCode);
    $("#See [name=contractContent]").html(arr[0].contractContent);
    $("#See [name=lastModifyTime]").html(arr[0].lastModifyTime);
    $("#See [name=contractNote]").html(arr[0].contractNote);
    $("#See [name=processedMan]").html(arr[0].processedMan);
    $("#See").dialog("show")
}

$("#See").dialog({
    title: "合同详情",
    btnBind(){

    }
})